class MG34WFire extends MP7MWFire;

#exec OBJ LOAD FILE=mgtex.utx
#exec OBJ LOAD FILE=KillingFloorHUD.utx
#exec OBJ LOAD FILE=Inf_Weapons_Foley.uax
#exec OBJ LOAD FILE=Inf_Weapons.uax

simulated function HandleRecoil(float Rec)
{
	local rotator NewRecoilRotation;
	local KFPlayerController KFPC;
	local KFPawn KFPwn;

	if( Instigator != none )
	{
		KFPC = KFPlayerController(Instigator.Controller);
		KFPwn = KFPawn(Instigator);
	}

	if( KFPC == none || KFPwn == none )
		return;

	if( !KFPC.bFreeCamera )
	{
		if( Weapon.GetFireMode(0).bIsFiring || (DeagleWFireB(Weapon.GetFireMode(1))!=none && 
			DeagleWFireB(Weapon.GetFireMode(1)).bIsFiring) )
		{
			NewRecoilRotation.Pitch = RandRange( maxVerticalRecoilAngle * 0.5, maxVerticalRecoilAngle );
			NewRecoilRotation.Yaw = RandRange( maxHorizontalRecoilAngle * 0.5, maxHorizontalRecoilAngle );

			NewRecoilRotation.Pitch += (VSize(Weapon.Owner.Velocity)* 3);
			NewRecoilRotation.Yaw += (VSize(Weapon.Owner.Velocity)* 3);
			NewRecoilRotation.Pitch += (Instigator.HealthMax / Instigator.Health * 5);
			NewRecoilRotation.Yaw += (Instigator.HealthMax / Instigator.Health * 5);
			NewRecoilRotation *= Rec;

			KFPC.SetRecoil(NewRecoilRotation,RecoilRate / (default.FireRate/FireRate));
		}
	}
}

defaultproperties
{
     FireAimedAnim="Bipod_Shoot_Loop"
     FireEndAimedAnim="Bipod_Shoot_End"
     FireLoopAimedAnim="Bipod_Shoot_Loop"
     RecoilRate=0.030000
     maxVerticalRecoilAngle=250
     maxHorizontalRecoilAngle=20
     ShellEjectBoneName="ejector"
     DamageType=Class'PerksSimHostOrg.DamTypeMG34W'
     DamageMin=75
     DamageMax=85
     Momentum=10000.000000
     FireLoopAnim="Bipod_Shoot_Loop"
     FireEndAnim="Bipod_Shoot_End"
     TweenTime=0.000000
     FireSound=SoundGroup'Inf_Weapons.mg34.mg34_fire_single'
     FireRate=0.070000
     AmmoClass=Class'PerksSimHostOrg.MG34WAmmo'
     ShakeRotMag=(X=50.000000,Y=50.000000,Z=50.000000)
     ShakeRotTime=2.000000
     ShakeOffsetMag=(X=3.000000,Y=1.000000,Z=3.000000)
     ShakeOffsetTime=2.000000
     aimerror=10.000000
     Spread=0.006000
}
